package com.j180.dao;

import com.j180.bean.CountBean;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ICoutDao {


    @Select("select cls.cname as className," +
            "        count(stu.name) as tolNum," +
            "       sum(case when stu.gender='男' then 1 else 0 end) as 'mNuml'," +
            "       sum(case when stu.gender='女' then 1 else 0 end) as 'fNuml'" +
            "              from  t_class as cls " +
            "              left join  t_student as stu on cls.cid = stu.c_id " +
            "              group by cls.cname ORDER BY cls.cid ")
    public List<CountBean>  getCountInfo();

}
